package com.kws.merchant.controller;


import com.kws.merchant.domain.OperationPolling;
import com.kws.merchant.domain.po.DisposePollingPo;
import com.kws.merchant.domain.po.OperationPollingPo;
import com.kws.merchant.domain.po.PollingPo;
import com.kws.merchant.service.OperationPollingService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;
import com.kws.common.core.domain.R;

import javax.annotation.Resource;
import java.util.List;
import java.util.UUID;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;

/**
 * 运维-巡检管理(OperationPolling)表控制层
 *
 * @author yxy
 * @since 2024-10-28 11:32:39
 */
@RestController
@Api(tags = "运维-巡检管理(OperationPolling)")
@RequestMapping("operationPolling")
public class OperationPollingController {
    /**
     * 服务对象
     */
    @Resource
    private OperationPollingService operationPollingService;
 
    @PostMapping("/page")
    @ApiOperation(value = "分页查询列表")
    public R<Page<OperationPolling>> pageList(@RequestBody PollingPo pollingPo){
        return R.ok(operationPollingService.pageList(pollingPo));
    }

    @GetMapping("/detailById/{id}")
    @ApiOperation(value = "查看")
    public R<OperationPolling> detailById(@PathVariable Long id) {
        return R.ok(operationPollingService.detailById(id));
    }


    @PostMapping("/addPolling")
    @ApiOperation(value = "新增巡检数据")
    public R addPolling(@RequestBody OperationPollingPo operationPollingPo) {
        return R.ok(operationPollingService.addPolling(operationPollingPo));
    }

    @PostMapping("/disposePolling")
    @ApiOperation(value = "处理巡检")
    public R disposePolling(@RequestBody DisposePollingPo disposePollingPo) {
        return R.ok(operationPollingService.disposePolling(disposePollingPo));
    }


    @PostMapping("/delete")
    @ApiOperation(value = "删除数据")
    public R delete(@RequestBody List<Long> idList) {
        return R.ok(operationPollingService.delete(idList));
    }
}
